<!DOCTYPE html>
<html lang="en">
<head>
    <meta name ="viewport" content ="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <meta charset="UTF-8">
    <title>农户施肥</title>
    <link rel="stylesheet" href="../css/style.css">
</head>
<body>
<div class="formula-content">
    <div class="formula-left">
        <ul>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
            <li>
                <a href="javascript:void(0)">张三</a>
            </li>
        </ul>
    </div>
    <div class="formula-right">
        <ul>
            <li>
                <a href="javascript:void(0)">化肥</a>
            </li>
            <li>
                <a href="javascript:void(0)">化肥</a>
            </li>
            <li>
                <a href="javascript:void(0)">化肥</a>
            </li>
            <li>
                <a href="javascript:void(0)">化肥</a>
            </li>
            <li>
                <a href="javascript:void(0)">化肥</a>
            </li>
        </ul>
    </div>
</div>
<script src="../js/method/jquery.2.1.1min.js"></script>
<script src="../js/method/fastclick.js"></script>
<script src="../js/method/axios.min.js"></script>
<script src="../js/function.js"></script>
<script src="../js/public.js"></script>
<script>
    $(function () {
        postAxios("",{uuid:getItem("uuid").uuid},function (data) {
            $.each(data,function (index, obj) {
                var html="";
                html+=`<li data-uuid="${obj.uuid}">
                         <a href="javascript:void(0)">${obj.name}</a>
                       </li>`;
                $(".formula-left>ul").appendChild(html)
            })
        });
        $(".formula-left").on("click","ul>li",function () {
            var index= $(this).index();
            $(this).addClass("actives").siblings().removeClass("actives");
            postAxios("",{uuid:$(this).attr("data-uuid")},function (data) {
                $.each(data,function (index,obj) {
                    var html="";
                    html+=`<li data-uuid="${obj.uuid}">
                                <a href="javascript:void(0)">${obj.name}</a>
                           </li>`;
                    $(".formula-right>ul").appendChild(html);
                })
            })
        });
        $(".formula-right").on("click","ul>li",function () {
            var uuid= $(this).attr("data-uuid");
            setItem("uuid",uuid)
        })
    });

</script>
</body>
</html>